import service from '@/utils/http'

const api = {
    /* 获取菜单列表 */
    getMenuList() {
        return service({
            method: 'post',
            url: '/menu/list',
        })
    },
    /* 获取菜单详情 */
    getMenuDetail(data:object) {
        return service({
            method: 'post',
            url: '/menu/detail',
            data,
        })
    },
    /* 保存菜单列表 */
    saveMenuList(data:object) {
        return service({
            method: 'post',
            url: '/menu/save',
            data,
        })
    },
    /* 更新菜单列表 */
    updateMenuList(data:object) {
        return service({
            method: 'post',
            url: '/menu/update',
            data,
        })
    },
    /* 删除菜单项 */
    deleteMenuList(data:object) {
        return service({
            method: 'post',
            url: '/menu/delete',
            data,
        })
    },
    /**
     * 获取菜单树
     */
    getTree() {
        return service({
            url: '/menu/getCategoryList',
            method: 'post',
        })
    },
}

export default api